/* 通用设置 */
body {
  margin: 0;
  padding: 0;
  font-family: 'PingFang SC', 'Microsoft YaHei', Arial, sans-serif;
  background: linear-gradient(135deg, #1a1a1a 0%, #3b2c23 100%);
  color: #f5f5f5;
  min-height: 100vh;
  box-sizing: border-box;
}

.section {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  width: 100vw;
  padding: 0 10px;
  box-sizing: border-box;
}

.section:not(.hidden) {
  display: flex;
}

.hidden {
  display: none !important;
}

.cover-img {
  width: 90vw;
  max-width: 400px;
  border-radius: 16px;
  box-shadow: 0 4px 24px #000a;
  margin-bottom: 24px;
}

.cover-title {
  font-size: 2.2rem;
  margin-bottom: 16px;
  letter-spacing: 2px;
  color: #ffe6b3;
  text-shadow: 0 2px 8px #000a;
}

.main-btn {
  background: linear-gradient(90deg, #3b2c23 0%, #1a1a1a 100%);
  color: #ffe6b3;
  border: none;
  border-radius: 8px;
  padding: 16px 36px;
  font-size: 1.3rem;
  margin: 18px 0 0 0;
  cursor: pointer;
  box-shadow: 0 2px 8px #0006;
  transition: background 0.2s, transform 0.2s;
}
.main-btn:hover {
  background: linear-gradient(90deg, #1a1a1a 0%, #3b2c23 100%);
  transform: scale(1.04);
}

.rules-content {
  background: rgba(40, 30, 20, 0.85);
  border-radius: 12px;
  padding: 18px 14px;
  margin-bottom: 18px;
  color: #f5f5f5;
  font-size: 1.08rem;
  line-height: 1.7;
  box-shadow: 0 2px 8px #0005;
  max-width: 420px;
}

/* 规则区按钮底部留白更大 */
#rules-section .main-btn {
  margin-bottom: 32px;
}
#back-to-cover-btn {
  margin-top: 0;
  margin-bottom: 48px;
  background: linear-gradient(90deg, #1a1a1a 0%, #3b2c23 100%);
  color: #ffe6b3;
  border: none;
  border-radius: 8px;
  padding: 12px 28px;
  font-size: 1.1rem;
  box-shadow: 0 2px 8px #0006;
  transition: background 0.2s, transform 0.2s;
}
#back-to-cover-btn:hover {
  background: linear-gradient(90deg, #3b2c23 0%, #1a1a1a 100%);
  transform: scale(1.04);
}

h2 {
  color: #ffe6b3;
  margin-bottom: 12px;
  font-size: 1.7rem;
}

/* 抽卡区样式 */
#role-section h2, #role-section .draw-tip {
  font-size: 1.5rem;
  color: #ffe6b3;
  margin-bottom: 18px;
  font-weight: bold;
  text-align: center;
}
#role-draw-area {
  display: flex;
  justify-content: center;
  gap: 6vw;
  margin: 32px 0 18px 0;
  width: 100vw;
}
.role-card-back, .role-card-front {
  width: 28vw;
  max-width: 180px;
  min-width: 90px;
  height: 38vw;
  max-height: 260px;
  min-height: 120px;
  background: url('assets/others/role_back.jpg') center/cover no-repeat;
  border-radius: 14px;
  box-shadow: 0 2px 16px #000a;
  cursor: pointer;
  transition: transform 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.role-card-back:hover {
  transform: scale(1.08) rotate(-2deg);
}
.role-card-front {
  background: #fff;
  object-fit: cover;
  justify-content: center;
  align-items: center;
}
.role-card-front img {
  width: 90%;
  height: 90%;
  object-fit: contain;
  border-radius: 12px;
}

#role-result {
  margin-top: 32px;
  text-align: center;
}
#role-result-text {
  font-size: 1.5rem;
  color: #ffe6b3;
  font-weight: bold;
  margin-bottom: 18px;
  text-shadow: 0 2px 8px #000a;
}

/* 主游戏区 */
#game-header {
  width: 100vw;
  max-width: 420px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  font-size: 1.1rem;
}
.coin-img {
  width: 28px;
  vertical-align: middle;
  margin-right: 4px;
}

#card-area {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: 18px 0 12px 0;
  min-height: 140px;
}
.district-card {
  width: 35vw;
  height: 50vw;
  max-width: 200px;
  max-height: 280px;
  min-width: 120px;
  min-height: 160px;
  border-radius: 8px;
  box-shadow: 0 2px 8px #000a;
  background: #222;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  cursor: pointer;
  transition: transform 0.2s;
}
.district-card.selected {
  outline: 3px solid #ffe6b3;
  z-index: 2;
  transform: scale(1.08);
}
.district-card img {
  width: 100%;
  height: 70%;
  object-fit: cover;
  border-radius: 8px 8px 0 0;
}
.district-card .district-info {
  width: 100%;
  background: rgba(40,30,20,0.85);
  color: #ffe6b3;
  font-size: 1.1rem;
  text-align: center;
  padding: 2px 0 4px 0;
  border-radius: 0 0 8px 8px;
  font-weight: bold;
}

#action-area {
  margin: 18px 0 0 0;
  width: 100vw;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

/* 视频弹窗 */
#video-popup {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.7);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s;
}
.video-popup-content {
  background: #2d1c13;
  border-radius: 14px;
  padding: 18px 12px 12px 12px;
  box-shadow: 0 2px 16px #000a;
  text-align: center;
  max-width: 320px;
}
#bless-video {
  width: 100%;
  border-radius: 8px;
  margin: 10px 0;
}

/* 结算区 */
#result-content {
  background: rgba(40, 30, 20, 0.85);
  border-radius: 12px;
  padding: 18px 14px;
  margin-bottom: 18px;
  color: #f5f5f5;
  font-size: 1.08rem;
  line-height: 1.7;
  box-shadow: 0 2px 8px #0005;
  max-width: 420px;
}

/* 动画 */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* 响应式适配 */
@media (max-width: 480px) {
  .cover-img, .rules-content, #game-header, #card-area, #action-area, #result-content {
    max-width: 98vw;
  }
  .district-card {
    width: 44vw;
    height: 62vw;
    max-width: 180px;
    max-height: 250px;
    min-width: 90px;
    min-height: 120px;
  }
  .role-card-back, .role-card-front {
    width: 32vw;
    min-width: 80px;
    height: 44vw;
    min-height: 100px;
    max-width: 160px;
    max-height: 220px;
  }
  #role-result-text {
    font-size: 1.2rem;
  }
}

/* 玩家信息面板样式 */
#player-panel {
  width: 100vw;
  max-width: 420px;
  margin: 0 auto 12px auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.player-block {
  background: rgba(40,30,20,0.85);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 2px 8px #0005;
  position: relative;
  transition: box-shadow 0.3s, border 0.3s;
}
.player-block.current {
  border: 2.5px solid #ffe6b3;
  box-shadow: 0 4px 16px #ffe6b3aa;
  animation: highlightPlayer 1.2s infinite alternate;
}
@keyframes highlightPlayer {
  from { box-shadow: 0 4px 16px #ffe6b3aa; }
  to   { box-shadow: 0 0px 8px #ffe6b355; }
}
.player-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.player-role-img {
  height: 40px;
  width: 40px;
  border-radius: 8px;
  object-fit: cover;
  margin-right: 6px;
  box-shadow: 0 1px 4px #0006;
}
.player-block.current .player-role-img {
  height: 60px;
  width: 60px;
}
.player-name {
  font-weight: bold;
  font-size: 1.1rem;
  color: #ffe6b3;
}
.skill-btn {
  background: #ffe6b3;
  color: #3b2c23;
  border: none;
  border-radius: 50%;
  width: 26px;
  height: 26px;
  font-size: 1.1rem;
  cursor: pointer;
  margin-left: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.skill-btn:hover {
  background: #fff2cc;
}
.player-coins {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 4px;
}
.player-coins img {
  width: 22px;
  vertical-align: middle;
}
.player-hand {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 4px;
  cursor: pointer;
}
.player-hand .hand-count {
  font-size: 1rem;
  color: #ffe6b3;
}
.player-hand .hand-img {
  width: 28px;
  height: 40px;
  object-fit: cover;
  border-radius: 4px;
  box-shadow: 0 1px 4px #0006;
}
.player-built {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.player-built .built-img {
  width: 32px;
  height: 32px;
  object-fit: cover;
  border-radius: 4px;
  box-shadow: 0 1px 4px #0006;
}

@keyframes fadeInCard {
  from { opacity: 0; transform: translateY(30px) scale(0.8);}
  to   { opacity: 1; transform: translateY(0) scale(1);}
}

.crown-img {
  position: relative;
  top: -8px;
  left: 2px;
  filter: drop-shadow(0 2px 6px #ffe6b3cc);
}

